export const commonData = (data = []) => {
    return {
        status: 0,
        msg: "success",
        data: data,
    };
};

export const listPage = ({
    page_num = 0,
    page_size = 0,
    total = 0,
    data = [],
    listKey = "items",
}) => {
    let itemsKey = listKey + "|" + page_size;
    let tpmObj: any = {
        page: {
            total, // 总条数
            page_size,
            page_num
        },
    };
    page_num--;
    tpmObj[itemsKey] = [
        {
            // id: '@increment(1)', // 自增id
            // id: '@id', // 随机id
            "id|+1": page_num * page_size,
            ...data,
        },
    ];
    return tpmObj;
};
